package com.icloud.article.boot.controller.admin;


import com.icloud.article.boot.dto.AdminConsumptionPageDto;
import com.icloud.article.boot.service.HotArticleService;
import com.icloud.article.boot.vo.AdminConsumptionVo;
import com.icloud.common.core.api.CommonResult;
import com.icloud.common.web.vo.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "后台热帖接口")
@RequestMapping("/admin/hot")
@RequiredArgsConstructor
public class AdminHotArticleController {
    private final HotArticleService hotArticleService;

    @ApiOperation("分页查询消耗列表")
    @PostMapping("/consumptionPage")
    public CommonResult<PageVO<AdminConsumptionVo>> consumptionPage(@Validated @RequestBody AdminConsumptionPageDto dto){
        return CommonResult.success(hotArticleService.consumptionPage(dto));
    }
}
